# -*- conding:UTF-8 -*-

'''
@ Project: funny
@ File: download.py
@ Author: 韩成瑾
@ Date：2022/10/13 20:41

'''

from youdao import youdao as yd

trans = {"英音": 1, "美音": 0, "英美": 3}


def download(pronunciation, word_list):
    sp = yd()
    if trans[pronunciation] == 0 or trans[pronunciation] == 3:  # 获取美音
        print("获取列表单词的美音音频: ", word_list)
        sp.setAccent(0)
        for one_word in word_list:
            sp.down(one_word)

    if trans[pronunciation] == 1 or trans[pronunciation] == 3:  # 获取英音
        print("获取列表单词的英音音频: ", word_list)
        sp.setAccent(1)
        for one_word in word_list:
            sp.down(one_word)
